import { createPinia, defineStore } from 'pinia'
import { GlobalState } from './interface/global'

export const GlobalStore = defineStore({
    id:"global",
    state:():GlobalState=>({
        referer:""
    }),
    getters:{
        getReferer:state=>{
            if(state.referer.startsWith("http")){
                return state.referer
            }else{
                return "https://" + state.referer
            }
        }
    },
    actions:{
        setReferer(url:string){
            this.referer = url
        }
    }
})
